# 元组和集合
# 元组的创建
tuple_01 = ('a','b','c',1,2,3)
tuple_02 = 'a','b','c',1,2,3
# print(tuple_01)
# print(tuple_02)
list_01 = [1,2,3]
tuple_03 = tuple(list_01)
# print(tuple_03)
tuple_04 = ()
# print(tuple_04)
tuple_05 = (1,)
# print(tuple_05)
item_01 = (12)
# print(item_01)

# 访问元组
# print(tuple_02[5])
# print(tuple_02[-1])

# 合并
tuple_06 = tuple_02 + tuple_03
# print(tuple_06)

# 遍历
# for i in tuple_06:
#     print(i)

# print(len(tuple_06))
# j = 0
# while j < len(tuple_06):
#     print(tuple_06[j])
#     j += 1

# 集合
# 创建
# set_01 = {'a','b','c',1,2,3}
# set_02 = {'a','aa','a','b',1,2,2,2,3,3,4,23}
# print(set_01)
# print(set_02)
#
# set_03 = set(list_01)
# print(set_03)
# list_02 = [1,2,3,4,[1,2,3]]
# # set_04 = set(list_02)  # list_02包含列表嵌套，不能转换成集合，会报错
# print(list_02)
# # print(set_04)

# 常用操作
# set_05 = {1,2,3,4}
# set_06 = {4,5,6,7,8,2}
# print(set_05)
# set_05.add(6)
# print(set_05)
# set_05.update(set_06)
# print(set_05)
# # item_02 = set_05.pop()
# # print(item_02)
# # print(set_05)
# set_05.remove(7)
# print(set_05)
# # set_05.remove(46)  # 此时set_05不包含46元素，不能执行remove操作会报错
# # print(set_05)
# set_05.discard(3)
# print(set_05)
# set_05.discard(46)  # 此时set_05不包含46元素，执行discard操作不会报错
# print(set_05)
# set_05.clear()
# print(set_05)
# # item_03 = set_05.pop()  # 此时set_05是空集合，不能执行pop操作，会报错
# # print(item_03)
# # print(set_05)

# 内置函数
# set_07 = {12,45,89,634,456,79,35,45,15}
# print(len(set_07))
# print(min(set_07))
# print(max(set_07))
# print(sorted(set_07))
# print(sorted(set_07,reverse=True))

# 集合运算
set_08 = {1,2,3,4,5}
set_09 = {3,4,5,6,7}
set_10 = {3,4,5,6}
# print(set_08 & set_09)
# print(set_08 | set_09)
# print(set_08 - set_09)
# print(set_08 ^ set_09)
# print(set_10 <= set_09)
# print(set_10 <= set_10)
# print(set_10 <= set_08)
# print(set_10 >= set_08)
# print(set_09 >= set_10)
# print(set_09 >= set_09)